linq foreach c#

87

linq foreach c# -

sequence.Where(x => x.Name.ToString().Equals("Apple"))
    .ToList()
    .ForEach( x =>
     {
       if(someCondition)
       {
         // Do some stuff here.
       }  
     });

linq foreach c# -

someValues.ToList().ForEach(x => list.Add(x + 1));

foreach c# linq example -

items.ToList().ForEach(i => i.DoStuff());

linq foreach c# -

someValues.ToList().ForEach(x => list.Add(x + 1));

Comments

Submit
0 Comments